// 引入ajax
import services from '../../services/services.js'

class Common {
  // 获取腾信云上传文件签名
  getCosSign(data, isLoading = false) {
    return services.ajax({
      url: '/v1/common/cos-sign',
      data: data,
      method: 'POST',
      isLoading
    })
  }
  
  // 单图上传(一次传一张)
  uploadImageToServer(data, isLoading = false) {
    return services.ajax({
      url: '/v1/common/uploadImage',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  // 多图上传(一次传一个数组)
  uploadImageListToServer(data, isLoading = false) {
    return services.ajax({
      url: '/v1/common/uploadImageList',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //上传单个音频(一次传一个audio)
  uploadAudioToServer(data, isLoading = false) {
    return services.ajax({
      url: '/v1/common/upload-audio',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //上传单个视频(一次传一个video)
  uploadVideoToServer(data, isLoading = false) {
    return services.ajax({
      url: '/v2/common/uploadVideo',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //问题反馈
  problemSave(data, isLoading = false) {
    return services.ajax({
      url: '/v1/problem/save',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  //问题反馈
    attendanceMyData(data, isLoading = false) {
    return services.ajax({
      url: '/v1/attendance/myData',
      data: data,
      method: 'POST',
      isLoading
    })
  }
  // 生词小程序码
  createMiniQRCode(data, isLoading = false) {
    return services.ajax({
      url: '/v1/common/createMiniQRCode',
      data: data,
      method: 'POST',
      isLoading
    })
  }

  // 生词小程序码scene 临时后台保存
  getSceneData(data, isLoading = false) {
    return services.ajax({
      url: '/v1/common/getSceneData',
      data: data,
      method: 'POST',
      isLoading
    })
  }


}


module.exports = new Common()